package com.example.administrator.xiaobo.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.Switch;
import android.widget.Toast;

import com.example.administrator.xiaobo.R;

public class SettingsActivity extends AppCompatActivity {

    private Switch sw;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_settings);
        sw= (Switch) findViewById(R.id.sw);
        sw.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
            @Override
            public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
                    if (isChecked) {
                        Toast.makeText(SettingsActivity.this, "打开提醒", Toast.LENGTH_SHORT).show();
                    }else{
                        Toast.makeText(SettingsActivity.this, "关闭提醒", Toast.LENGTH_SHORT).show();
                    }
                }

        });
    }
    public void click(View v){
        switch (v.getId()) {
            case R.id.iv_back:
                finish();
                break;

            case R.id.opinion:
                Intent intent = new Intent(this, OpinionActivity.class);
                intent.putExtra("id","opinion");
                startActivity(intent);
                break;
            case R.id.about:
                Intent intent1 = new Intent(this,OpinionActivity.class);
                intent1.putExtra("id","about");
                startActivity(intent1);
                break;
            case R.id.updata:
                Toast.makeText(this, "正在检查版本更新", Toast.LENGTH_SHORT).show();
                Toast.makeText(SettingsActivity.this, "已经是最新版本", Toast.LENGTH_SHORT).show();

                break;
            case R.id.btn_gone:

                break;
        }
    }
}
